package com.weilele.mvvmlib.sample.fg

import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.weilele.mvvmlib.databinding.HolderMeiziBinding

class MeizhiAdapter(val datas: MutableList<MeiziBean.DataDTO>) :
    RecyclerView.Adapter<MeiziHolder>() {
    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MeiziHolder {
        return MeiziHolder(
            HolderMeiziBinding.inflate(
                LayoutInflater.from(parent.context),
                parent,
                false
            )
        )
    }

    override fun onBindViewHolder(holder: MeiziHolder, position: Int) {
             holder.mBinding.ivPic.setImageUrl("http://gank.io/images/19c99c447e0a40a6b3ff89951957cfb1")
    }

    override fun getItemCount(): Int {
        return datas.count()
    }
}